.PHONY: all image clean

VERSION = $(shell xmllint --xpath "/*[local-name()='project']/*[local-name()='version']/text()" ../pom.xml)

all: image

image: ../target/neurons-$(VERSION).jar
	docker build --build-arg=VERSION=$(VERSION) -t ipout/neurons:$(VERSION) -f ./Dockerfile ..
	docker tag ipout/neurons:$(VERSION) ipout/neurons:latest

../target/neurons-$(VERSION).jar: $(shell find ../src -type f)
	cd ..; ./mvnw package

clean:
	cd ..; ./mvnw clean

